<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <h1>1111111</h1>

    <script>

        // 鼠标事件补充

        //    鼠标按下或者抬起事件   左键,右键,滚轮都可以触发
        //       e.button  判断    0左键   1滚轮   2右键

        //    鼠标移入移出
        //        over   out

        //        enter  leave    一般不建议使用

        document.onmousedown = function (e) {
            // console.log(1);
            console.log(e.button);
        }


        var oH1 = document.querySelector('h1');
        oH1.onmouseenter = function () {
            console.log('enter');
        }
        oH1.onmouseleave = function () {
            console.log('leave');
        }

    </script>

</body>

</html>